Skip to content

Kadai2-dshirae - #16

Open
showchan wants to merge 2 commits into
masterfrom
kadai2-dshirae
Open

Kadai2-dshirae#16
showchan wants to merge 2 commits into
masterfrom
kadai2-dshirae

Conversation

@showchan

Copy link
Copy Markdown

課題2

テストを書いてみよう

1回目の宿題のテストを作ってみてください

  • テストのしやすさを考えてリファクタリングしてみる
    課題1に実装しなかった、ユーザ定義型を作ってみる を実装した
  • テストのカバレッジを取ってみる
    課題提出時コードにて80% のカバレッジ
    $ go test -coverprofile=cover.out -run ''
    $ go tool cover -html=cover.out
  • テーブル駆動テストを行う
    実装しました
  • テストヘルパーを作ってみる
    実装したが、うまく使えてない気がする。(再調査)

io.Readerとio.Writer

io.Readerとio.Writerについて調べてみよう

  • 標準パッケージでどのように使われているか
    [WIP]
  • io.Readerとio.Writerがあることでどういう利点があるのか具体例を挙げて考えてみる
    抽象化された事でOS間の違いが吸収される。標準出力(console)など

dshirae and others added 2 commits June 2, 2019 11:28
Comment thread kadai1/dshirae/chimgs.go
flag.Parse()

if (flag.NArg() == 0) && (flag.NFlag() == 0) {
fmt.Println("Usage: chimgs DIR [-i=imgext] [-o=imgext]")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

標準エラー出力にだす

Comment thread kadai1/dshirae/chimgs.go
}
dirname := flag.Arg(0)

filepath.Walk(dirname,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

エラー処理

if err != nil {
return err
}
defer savefile.Close()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

エラー処理

Comment thread kadai2/dshirae/chimgs.go
"os"
"path/filepath"

"./convert"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

相対パスにしない

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants